Majority Element ​
Find the element that appears more than n/2 times in the array.
Approach ​
Approach 1: Use a hashmap to count, when count = n/2
Approach 2: Moore's Voting Algorithm > Single Pass Moore's Algorithm
Find the element that appears more than n/2 times in the array.
Approach 1: Use a hashmap to count, when count = n/2
Approach 2: Moore's Voting Algorithm > Single Pass Moore's Algorithm